package com.example.test2.activity;

import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;

import androidx.annotation.NonNull;

import com.example.test2.R;
import com.example.test2.databinding.ActivitySettingBinding;

public class SettingActivity extends BaseActivity<ActivitySettingBinding> implements View.OnClickListener{

    @Override
    protected void initData() {
        super.initData();
        getBinding().titleBar.setTitle("设置");

    }
    @Override
    protected void initClick() {
        super.initClick();
        getBinding().titleBar.setLeftIconOnClickListener(v -> {
            finish();
        });
        getBinding().btLogout.setOnClickListener(this);
        getBinding().rlPwd.setOnClickListener(this);
    }

    @Override
    protected int initLayout() {
        return R.layout.activity_setting;
    }

    @Override
    protected ActivitySettingBinding onCreateViewBinding(@NonNull LayoutInflater layoutInflater) {
        return ActivitySettingBinding.inflate(layoutInflater);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.bt_logout:
                startActivity(new Intent(this, LoginActivity.class));
                finish();
                break;
            case R.id.rl_pwd:
                startActivity(new Intent(this, EditPwdActivity.class));
                finish();
                break;
        }
    }



}
